home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / tri14dev.lha / Triton / Developer / DemoSource / toolmanager1.c < prev    next >
C/C++ Source or Header  |  1995-08-25  |  3KB  |  138 lines

  1. /*
  2.  *  Triton - The object oriented GUI creation system for the Amiga
  3.  *  Written by Stefan Zeiger in 1993-1995
  4.  *
  5.  *  (c) 1993-1995 by Stefan Zeiger
  6.  *  You are hereby allowed to use this source or parts
  7.  *  of it for creating programs for AmigaOS which use the
  8.  *  Triton GUI creation system. All other rights reserved.
  9.  *
  10.  *  Toolmanager1.c - Looks like the original ToolManager
  11.  *
  12.  */
  13.  
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18.  
  19. #include <libraries/triton.h>
  20.  
  21. #ifdef __GNUC__
  22. #ifndef __OPTIMIZE__
  23. #include <clib/triton_protos.h>
  24. #else
  25. #include <inline/triton.h>
  26. #endif /* __OPTIMIZE__ */
  27. #else
  28. #include <proto/triton.h>
  29. #endif /* __GNUC__ */
  30.  
  31.  
  32. STRPTR cycle_entries[]={"Exec","Image","Sound","Menu","Icon","Dock","Access",NULL};
  33.  
  34. extern struct List LVList;
  35.  
  36. struct Node LVNodes[] =
  37. {
  38.   { &LVNodes[1], (struct Node *)&LVList.lh_Head,  0, 0, "2024view" },
  39.   { &LVNodes[2], &LVNodes[0],                     0, 0, "Add to archive" },
  40.   { &LVNodes[3], &LVNodes[1],                     0, 0, "Delete" },
  41.   { &LVNodes[4], &LVNodes[2],                     0, 0, "Edit text" },
  42.   { &LVNodes[5], &LVNodes[3],                     0, 0, "Env" },
  43.   { &LVNodes[6], &LVNodes[4],                     0, 0, "Exchange" },
  44.   { &LVNodes[7], &LVNodes[5],                     0, 0, "Global Help System" },
  45.   { &LVNodes[8], &LVNodes[6],                     0, 0, "Multiview" },
  46.   { (struct Node *)&LVList.lh_Tail, &LVNodes[7],  0, 0, "Paint" }
  47. };
  48.  
  49. struct List LVList={&LVNodes[0],NULL,&LVNodes[8],0,0};
  50.  
  51.  
  52. int main(void)
  53. {
  54.   if(TR_OpenTriton(TRITON11VERSION,TRCA_Name,"ToolManagerGUIDemo1",TRCA_LongName,"ToolManager GUI demo 1",TRCA_Info,"Looks like the original ToolManager",TAG_END))
  55.   {
  56.     TR_AutoRequestTags(Application,NULL,
  57.       WindowID(0), WindowPosition(TRWP_BELOWTITLEBAR),
  58.       WindowTitle("ToolManager GUI demo 1"), WindowFlags(TRWF_NOSIZEGADGET|TRWF_NODELZIP|TRWF_NOZIPGADGET|TRWF_NOESCCLOSE),
  59.       WindowBackfillNone,
  60.  
  61.       VertGroupA,
  62.  
  63.         Space,
  64.  
  65.         HorizGroupAC,
  66.           Space,
  67.           TextID("_Object Type",1),
  68.           Space,
  69.           CycleGadget(cycle_entries,0,1),
  70.           Space,
  71.         EndGroup,
  72.  
  73.         Space,
  74.  
  75.         HorizGroupAC,
  76.           Space,
  77.             VertGroupAC,
  78.               CenteredTextID("Object List",2),
  79.               Space,
  80.               ListSSCN(&LVList,2,0,0),
  81.             EndGroup,
  82.           Space,
  83.             VertGroupA,
  84.               TextN(""),
  85.               Space,
  86.               Button("Top",3),
  87.               Space,
  88.               Button("Up",4),
  89.               Space,
  90.               Button("Down",5),
  91.               Space,
  92.               Button("Bottom",6),
  93.               Space,
  94.               Button("So_rt",7),
  95.             EndGroup,
  96.           Space,
  97.         EndGroup,
  98.  
  99.         Space,
  100.  
  101.         HorizGroupEA,
  102.           Space,
  103.           Button("_New...",8),
  104.           Space,
  105.           Button("_Edit...",9),
  106.           Space,
  107.           Button("Co_py",10),
  108.           Space,
  109.           Button("Remove",11),
  110.           Space,
  111.         EndGroup,
  112.  
  113.         Space,
  114.  
  115.         HorizGroupEA,
  116.           Space,
  117.           Button("_Save",12),
  118.           Space,
  119.           Button("_Use",13),
  120.           Space,
  121.           Button("_Test",14),
  122.           Space,
  123.           Button("_Cancel",15),
  124.           Space,
  125.         EndGroup,
  126.  
  127.         Space,
  128.  
  129.       EndGroup,
  130.  
  131.       TAG_END);
  132.     TR_CloseTriton();
  133.     return 0;
  134.   }
  135.   puts("Can't open triton.library v2+.");
  136.   return 20;
  137. }
  138.